home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / ddx / sprite.X11R3 / sunkeyboardlockfix < prev   
Encoding:
Text File  |  1989-08-16  |  2.3 KB  |  82 lines

  1. *** /tmp/,RCSt1003433    Thu Oct 22 09:20:46 1987
  2. --- sunKbd.c    Thu Oct 22 09:20:27 1987
  3. ***************
  4. *** 51,57 ****
  5. --- 51,60 ----
  6.   #include <stdio.h>
  7.   #include "Xproto.h"
  8.   #include "keysym.h"
  9. + #include "inputstr.h"
  10.   
  11. + extern CARD16 keyModifiersList[];
  12.   typedef struct {
  13.       int              trans;              /* Original translation form */
  14.   } SunKbPrivRec, *SunKbPrivPtr;
  15. ***************
  16. *** 365,370 ****
  17. --- 368,374 ----
  18.       PtrPrivPtr          ptrPriv;
  19.       int            delta;
  20.       static xEvent    autoRepeatEvent;
  21. +     BYTE        key;
  22.   
  23.       ptrPriv = (PtrPrivPtr) LookupPointerDevice()->devicePrivate;
  24.   
  25. ***************
  26. *** 402,421 ****
  27.       return;
  28.       }
  29.   
  30. !     /*
  31. !      * Kill AutoRepeater on any real Kbd event.
  32. !      */
  33. !     autoRepeatKeyDown = 0;
  34. !     if (autoRepeatDebug)
  35. !     ErrorF("sunKbdProcessEvent: autoRepeat off\n");
  36.   
  37.       xE.u.keyButtonPointer.time = TVTOMILLI(fe->time);
  38.       xE.u.keyButtonPointer.rootX = ptrPriv->x;
  39.       xE.u.keyButtonPointer.rootY = ptrPriv->y;
  40.       xE.u.u.type = ((fe->value == VKEY_UP) ? KeyRelease : KeyPress);
  41. !     xE.u.u.detail = (fe->id & 0x7F) + sysKbPriv.offset;
  42.   
  43. !     if (fe->value == VKEY_DOWN) {    /* turn on AutoRepeater */
  44.       if (autoRepeatDebug)
  45.               ErrorF("sunKbdProcessEvent: VKEY_DOWN\n");
  46.       autoRepeatEvent = xE;
  47. --- 406,438 ----
  48.       return;
  49.       }
  50.   
  51. !     key = (fe->id & 0x7F) + sysKbPriv.offset;
  52. !     if (!keyModifiersList[key])
  53. !     {
  54. !     /*
  55. !      * Kill AutoRepeater on any real non-modifier Kbd event.
  56. !      */
  57. !     autoRepeatKeyDown = 0;
  58. !     if (autoRepeatDebug)
  59. !         ErrorF("sunKbdProcessEvent: autoRepeat off\n");
  60. !     }
  61.   
  62.       xE.u.keyButtonPointer.time = TVTOMILLI(fe->time);
  63.       xE.u.keyButtonPointer.rootX = ptrPriv->x;
  64.       xE.u.keyButtonPointer.rootY = ptrPriv->y;
  65.       xE.u.u.type = ((fe->value == VKEY_UP) ? KeyRelease : KeyPress);
  66. !     xE.u.u.detail = key;
  67.   
  68. !     if (keyModifiersList[key] & LockMask)
  69. !     {
  70. !     if (xE.u.u.type == KeyRelease)
  71. !         return; /* this assumes autorepeat is not desired */
  72. !     if (((DeviceIntPtr)pKeyboard)->down[key >> 3] & (1 << (key & 7)))
  73. !         xE.u.u.type = KeyRelease;
  74. !     }
  75. !     if ((fe->value == VKEY_DOWN) && !autoRepeatKeyDown)
  76. !     {    /* turn on AutoRepeater */
  77.       if (autoRepeatDebug)
  78.               ErrorF("sunKbdProcessEvent: VKEY_DOWN\n");
  79.       autoRepeatEvent = xE;
  80.